package Book;

//书架。存放图书
public class BookList {
    private Book[] books = new Book[10];
    private int numBook = 0;

    public BookList() {
        books[0] = new Book("三国演义","罗贯中",96,"小说");
        books[1] = new Book("水浒传","施耐庵",66,"小说");
        books[2] = new Book("哈利波特","J.K.罗琳",108,"小说");
        this.numBook = 3;
    }

    public int getNumBook() {
        return numBook;
    }

    public void setNumBook(int numBook)
    {
        this.numBook = numBook;
    }

    public Book getpos(int pos)
    {
        return books[pos];
    }

    //存储一本书到指定位置
    public void setBooks(Book book, int index) {
        books[index] = book;
    }
}
